package tests;

import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import som.ForestFiresNetwork1D;
import som.Network1D;

public class NetworkMethodsTests {

	private Network1D network;
	@Before
	public void setUp() throws Exception {
		network = new ForestFiresNetwork1D(60, 4);
	}
	
	@Test
	public void euclidean1() {
		assertEquals(2, network.euclideanDistance(1, 3), 0.001);
	}
	
	@Test
	public void euclidean2() {
		assertEquals(5, network.euclideanDistance(10, 15), 0.001);
	}
	
	@Test
	public void learning1() {
		assertEquals(0.08, network.learningRatio(100), 0.01);
	}
	
	@Test
	public void neighborhood1() {
		assertEquals(0.6, network.neighborhood(1000, 1), 0.01);
	}
}
